var IsBeing = true;

function pullDown(pullName) {
    $(pullName).slideToggle("1000");
}

function pullDownAdd() {
    $("#pull-down-form").slideToggle("1000");
}

function slideUpPullDownAdd() {
    $("#pull-down-form").slideUp("1000");
}

function pullDownChangeInfo(inventoryId) {
    $("#none-inventory-id").val(inventoryId);
    $("#change-info-form").slideToggle("1000");
}

function slideUpType() {
    $(".type").slideUp("slow");
}

function showExtendBox() {
    $("#display").animate({ width: '62%' }, "1000");
    $("#extend-box").animate({ width: '22%' }, "1000");
    $("#menu").animate({ width: '16%' }, "1000");
    $("#keep-out").animate({ width: '80%' }, "1000");
}

function concealExtendBox() {
    $("#display").animate({ width: '80%' }, "1000");
    $("#menu").animate({ width: '20%' }, "1000");
    $("#keep-out").animate({ width: '0%' }, "1000");
    $("#extend-box").slideUp("1000");
    $("#extend-box").width('0%');
    $("#extend-box").height('0%');
    $("#extend-box").slideDown("1000");
}

function clearButton(divName, typeId) {
    var tools = $(divName);
    if (!IsBeing) {
        tools.html("······");
        IsBeing = true;
    }
    else {
        slideUpPullDownAdd();
        tools.html("<a onclick=\"deleteType("+typeId+")\" style=\"text-decoration:none; cursor: pointer;\" id=\"a-delete\" class=\"a-tools\" ><span class=\"span-tools\" id=\"span-delete\">删除</span></a>"+
                    "<a href=\"/Type/CompileTypeView?typeId=" + typeId + "\" style=\"text-decoration:none;cursor: pointer;\" id=\"a-compile\" class=\"a-tools\"><span class=\"span-tools\" id=\"span-compile\">编辑</span></a>" +
                    "<a onclick=\"createInventory("+typeId+")\" style=\"text-decoration:none;cursor: pointer;\" id=\"a-compile\" class=\"a-tools\"><span class=\"span-tools\" id=\"span-compile\">添加</span></a>");
        IsBeing = false;
    }
}

